<?php

namespace app\common\model;

use think\Model;


class OrderGoods extends Model
{

    

    

    // 表名
    protected $name = 'order_goods';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
	
	public function getOrderItems($orderId)
	{
		return $this->alias('i')
			->join('goods g', 'i.goods_id = g.id', 'left')
			->join('goodsSpec s', 'i.spec_id = s.id', 'left')
			->where([
				'i.order_id' => $orderId
			])
			->field('i.id, ')
			->select();
	}
	
	
}
